package com.atguigu.day08.exer;

public enum Month {
    JANUARY,
    FEBRUARY,
    MARCH,
    APRIL,
    MAY,
    JUNE,
    JULY,
    AUGUST,
    SEPTEMBER,
    OCTOBER,
    NOVEMBER,
    DECEMBER;

    private int value;
    private String description;

    Month() {
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static Month getByValue(int value) {
        switch (value) {
            case 1:
                return JANUARY;
        }
        return Month.values()[value - 1];
    }

    @Override
    public String toString() {
        return "Month{" + "value=" + value + ", description='" + description + '\'' + '}';
    }
}
